<?php
namespace app\common\model;

use app\index\model\UserModel;
use think\Model;

class FinancialRecordsModel extends Model{


    protected $table = 'boyi_financial_records';
    protected $pk = 'id';


    public function toUser(){
        return $this->hasOne(UserModel::class, 'id', 'to_uid')->field('id,name');
    }

    public function boyiUser(){
        return $this->hasOne(UserModel::class, 'id', 'boyi_uid')->field('id,name');
    }

    public function customer(){
        return $this->hasOne(CustomerModel::class, 'id', 'customer_id')->field('id,name,clue');
    }

}